package Java;

public class work28 {
	public static void main(String[] args){
		int a[] = {55,75,96,32,1,20,42,33,88,10};
		selectSort(a);
		for(int i = 0;i<a.length;i++){
			System.out.println(a[i]);
		}
	}
	public static void selectSort(int [] arr){
		for(int i = 0;i < arr.length-1;i++){
			int minIndex = i;
			for(int j = i + 1;j<arr.length;j++){
				if(arr[j]<arr[minIndex]){
					minIndex = j;
				}
			}
			if(i != minIndex){
				int temp = arr[i];
				arr[i] = arr[minIndex];
				arr[minIndex] = temp;
			}
		}
	}
}
